/*  This file is part of Real Time Digital Audio Processing library.
 *  Copyright (C) 2008 - Aravindh Krishnamoorthy
 *
 *  Real Time Digital Audio Processing library is free software: you can
 *  redistribute it and/or modify it under the terms of the GNU General
 *  Public License as published by the Free Software Foundation, either
 *  version 2 of the License, or (at your option) any later version.
 *
 *  Real Time Digital Audio Processing library is distributed in the hope
 *  that it will be useful, but WITHOUT ANY WARRANTY; without even the
 *  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *  See the GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Real Time Audio Processing library.
 *  If not, see <http://www.gnu.org/licenses/>.
 */

#include <assert.h>
#include <string.h>

#include "Audio.h"
#include "Generate.h"
#include "Gain.h"

int main(int argc, char* argv []) {
    float lingain = 1.5;

    printf("%s: Test for Gain Module\n", argv [0]);
    printf("Usage: %s [--gain <lineargain>]\n", argv[0]);
    printf("Copyright (C) 2008 Aravindh Krishnamoorthy\n");
    printf("Released under GPL version 2 or later, see README for details.\n");
    printf("\n") ;

    assert (argc == 1 || argc == 3);
    if (argc == 3) {
        assert (strcmp (argv[1], "--gain") == 0);
        lingain = atof (argv [2]);
        printf ("Linear gain: %f\n", lingain);
    }

    DSP* dsp = new DSP();
    dsp->add(new Sine(dsp->getSampleRate(), 0.1, 997));
    dsp->add(new Gain(lingain));

    Audio(dsp, 5.0);

    return 0 ;
}
